<template>
	<view class="img-user">
		<view class="user-list">
			<view class="list">
				<view @click="getCollect" class="item">收藏记录</view>
				<view v-if="off" @click="getBoss" class="item">后台管理ba</view>
				<view @click="getAbout" class="item">关于我们</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				off:false
			};
		},
		onLoad() {
			this.juUser()
		},
		methods:{
			getCollect(){
				uni.navigateTo({
					url:'/pages/img-collect/img-collect'
				})
			},
			getBoss(){
				uni.navigateTo({
					url:'/pages/user/user'
				})
			},
			getAbout(){
				uni.navigateTo({
					url:'/pages/about/about'
				})
			},
			juUser(){
				const open = uni.getStorageSync('open')
				// common.User(open)
				// this.off = common.demo
				// console.log(common.demo)
				// console.log(this.off)
				// console.log(common.User(open))
				const db = uniCloud.database();
				db.collection('bz-boss').where({
					openid:open
				}).get()
				.then(res=>{
					console.log(res.result.data.length,'返回结果')
					const lg = res.result.data.length
					if(lg==1){
						this.off = true
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.img-user{
		padding: 25rpx;
		.user-list{
			padding: 25rpx;
			border-radius: 10rpx;
			//border: 1rpx solid #d9d9d9;
			box-shadow:
			  2px 1.1px 3.6px rgba(0, 0, 0, 0.038),
			  5.5px 3.1px 10px rgba(0, 0, 0, 0.055),
			  13.3px 7.5px 24.1px rgba(0, 0, 0, 0.072),
			  44px 25px 80px rgba(0, 0, 0, 0.11)
			;
			.list{
				.item{
					color: #707070;
					padding: 8rpx;
					border-bottom: 1rpx solid #eceef1;
				}
			}
		}
	}
</style>
